<div class="form">

	<?php
	$form = $this->beginWidget(
		'CActiveForm', array('id'=>'office-form', 'enableAjaxValidation'=>false)
	);
	?>

	<p class="note">
		Fields with <span class="required">*</span> are required.
	</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php
		echo $form->labelEx($model, 'type');
		?>
		<?php
		$list = array(
			Office::TYPE_SECRETARIAT=>Office::TYPE_SECRETARIAT,
			Office::TYPE_JANOKO=>Office::TYPE_JANOKO,
		);
		echo $form->dropDownList($model, 'type', $list);
		?>
		<?php echo $form->error($model, 'type'); ?>
	</div>

	<div class="row">
		<?php
		echo $form->labelEx($model, 'name');
		?>
		<?php
		echo $form->textField(
			$model, 'name', array('size'=>60, 'maxlength'=>255)
		);
		?>
		<?php echo $form->error($model, 'name'); ?>
	</div>

	<div class="row">
		<?php
		echo $form->labelEx($model, 'address');
		?>
		<?php
		echo $form->textArea(
			$model, 'address', array('rows'=>6, 'cols'=>50)
		);
		?>
		<?php echo $form->error($model, 'address'); ?>
	</div>

	<div class="row">
		<?php
		echo $form->labelEx($model, 'province');
		?>
		<?php
		$properties = array(
			'model'=>$model,
			'attribute'=>'province',
			'source'=>$this->createUrl('province/autoComplete'),
			'htmlOptions'=>array('placeholder'=>'Any'),
			'options'=>array('showAnim'=>'fold'),
		);
		$this->widget('zii.widgets.jui.CJuiAutoComplete', $properties);
		?>
		<?php
		echo $form->error($model, 'province');
		?>
	</div>

	<div class="row">
		<?php
		echo $form->labelEx($model, 'city');
		?>
		<table>
			<tr>
				<td>
					<?php
					$list = array(
						City::TYPE_REGENCY=>City::TYPE_REGENCY,
						City::TYPE_MUNICIPALITY=>City::TYPE_MUNICIPALITY,
					);
					echo $form->dropDownList($model, 'cityType', $list);
					?>
				</td>
				<td class="fill">
					<?php
					$properties = array(
						'model'=>$model,
						'attribute'=>'city',
						'source'=>$this->createUrl('city/autoComplete'),
						'htmlOptions'=>array('placeholder'=>'Any'),
						'options'=>array('showAnim'=>'fold'),
					);
					$this->widget(
						'zii.widgets.jui.CJuiAutoComplete', $properties
					);
					?>
				</td>
			</tr>
		</table>
		<?php
		echo $form->error($model, 'city');
		?>
	</div>

	<div class="row">
		<?php
		echo $form->labelEx($model, 'phones');
		?>
		<?php
		echo $form->textArea(
			$model, 'phones', array('rows'=>6, 'cols'=>50)
		);
		?>
		<?php echo $form->error($model, 'phones'); ?>
	</div>

	<div class="row">
		<?php
		echo $form->labelEx($model, 'emails');
		?>
		<?php
		echo $form->textArea(
			$model, 'emails', array('rows'=>6, 'cols'=>50)
		);
		?>
		<?php echo $form->error($model, 'emails'); ?>
	</div>

	<div class="row">
		<?php
		echo $form->labelEx($model, 'urls');
		?>
		<?php
		echo $form->textArea(
			$model, 'urls', array('rows'=>6, 'cols'=>50)
		);
		?>
		<?php echo $form->error($model, 'urls'); ?>
	</div>

	<div class="row">
		<?php
		echo $form->labelEx($model, 'ims');
		?>
		<?php
		echo $form->textArea($model, 'ims', array('rows'=>6, 'cols'=>50));
		?>
		<?php echo $form->error($model, 'ims'); ?>
	</div>

	<div class="row buttons">
		<?php
		echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save');
		?>
	</div>

	<?php $this->endWidget(); ?>

</div><!-- form -->